//
//  ICShareTextView.m
//  ICome
//
//  Created by ENN on 16/8/30.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "ICShareTextView.h"
#import "ICShareInstance.h"
#import "ICHeaderFile.h"

@interface ICShareTextView ()

@property (nonatomic, weak) UILabel *contentLabel;
@property (nonatomic, weak) UIView *contentBgView;

@end

@implementation ICShareTextView


- (void)setShareData:(ICShareInstance *)shareData
{
    [super setShareData:shareData];
    
    NSString *text = shareData.shareObject.textObject.text;
    self.contentLabel.text = text;
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    self.contentBgView.frame = CGRectMake(20, self.imageV.bottom+15, self.width-40, 69);
    self.contentLabel.frame = CGRectMake(10, 0,_contentBgView.width-20,_contentBgView.height);
    [self bottomViewFrameWithView:_contentBgView];
}


#pragma mark - Getter

- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.backgroundColor = [UIColor clearColor];
        label.font = [UIFont systemFontOfSize:15.0];
        label.textColor = ICRGB(0x626a74);
        label.numberOfLines = 0;
        [self.contentBgView addSubview:label];
        _contentLabel = label;
    }
    return _contentLabel;
}

- (UIView *)contentBgView
{
    if (!_contentBgView) {
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = IColor(230, 234, 234);
        view.layer.masksToBounds = YES;
        view.layer.cornerRadius = 5.0;
        [self addSubview:view];
        _contentBgView = view;
    }
    return _contentBgView;
}




@end
